#!/usr/bin/env python
import commands
import sys
from string import strip


_cli = 'scp weixin@%s:/data/server/tomcat_8080/logs/localhost.2014-05-19.log /data/logs/%s_localhost.out'

"""
#ag host
10.6.97.44 ag1
10.6.97.45 ag2
10.6.97.48 ag3
10.6.97.52 ag5
10.6.97.53 ag6
10.6.97.54 ag7
10.6.97.55 ag8


#wm host
10.6.97.46  wm1
10.6.97.50  wm3
10.6.97.51  wm4
10.6.97.56  wm5
10.6.97.57  wm6
10.6.97.58  wm7
10.6.97.59  wm8
10.6.97.60  wm9
10.6.97.61  wm10
10.6.97.62  wm11
10.6.97.63  wm12
10.6.97.64  wm13
10.6.97.65  wm14
10.6.97.66  wm15
"""

servers = [
    'wm1','wm3','wm4','wm5','wm6','wm7','wm8','wm9','wm10','wm11','wm12','wm13','wm14','wm15'
]



def execmd(cmd):
    status,output = commands.getstatusoutput(cmd)







if __name__ == '__main__':
    #host = strip(sys.argv[1])
    #src = strip(sys.argv[1])
    #dst = strip(sys.argv[1])
    #print 'CMD: %s' % cmd

    for host in servers:
        execmd(_cli % (host,host))


